﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDT.Model;
using SDT.Systems;
using System.Web.Mvc;
using SDT.Lib.Paging;
using System.Web.UI.WebControls;

namespace SDT.Admin.ViewModels
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 07/07/2011
    /// </summary>
    public class DemandCategoryViewModels
    {
        public IPagedList<DemandCategory> Categories;
        public int? CurrentPubStatus;
        public string Keyword;
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }
        public string ImageRootUrl;
        // inseted by Vietlv (AddDate: 25/07/2011)
        public List<DemandType> DemandTypes { get; set;}
        public int currentDemandTypeID { get; set; }
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 07/07/2011
    /// </summary>
    public class DemandCategoryInputModels
    {
        public DemandCategoryInputModels()
        {
            // Nothing to do
        }

        private DemandCategory _cat = new DemandCategory();
        public DemandCategory Category
        {
            get
            {
                return this._cat;
            }
            set
            {
                if (value != null)
                    this._cat = value;
            }
        }

        private List<DemandCategory> _listParentCategory = new List<DemandCategory>();
        public List<DemandCategory> ListParentCategories
        {
            get
            {
                return this._listParentCategory;
            }
            set
            {
                if (value != null)
                    this._listParentCategory = value;
            }
        }

        public int? ParentID
        {
            get;
            set;
        }

        public int ID
        {
            get;
            set;
        }
        // inseted by Vietlv (AddDate: 25/07/2011)
        public List<DemandType> DemandTypes { get; set; }
        public int currentDemandTypeID { get; set; }
        public DemandType DemandType { get; set; }
    }
}
